﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：今日抢购
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;

public partial class Goods_TodayRush : BasePage
{
    protected QueryGoodsAsPage q; //分页查询对象；
    protected List<GoodsInfo> listOfGoods; //商品结果集；
    protected List<News> listOfNews; //点客动态；

    protected URLManage bllUrl = new URLManage();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            InitPageInfo();
        }
    }

    #region "初始化页面基本信息"
    /// <summary>
    /// 初始化页面基本信息
    /// </summary>
    private void InitPageInfo()
    {
        q = new QueryGoodsAsPage(true); //初始化查询条件；

        NewsManage bllNews = new NewsManage();
        listOfNews = bllNews.QueryNews(3, CConst.点客动态, true);  //查询点客动态；

        GoodsManage bllGoods = new GoodsManage();
        q.CommendCategoryID = 24;
        q.Status = Status.正用.ToString();
        q.SaleStatus = GoodsSaleStatus.已上架.ToString();
        q.PageSize = 16;
        listOfGoods = bllGoods.QueryListAsPage(q); //查询商品；

        List<string> goodsIds;
        if (listOfGoods != null)
        {
            goodsIds = new List<string>();
            foreach (GoodsInfo g in listOfGoods)
                goodsIds.Add(g.BaseInfo.GoodsID.ToString());
            ucRelate.BindData(goodsIds);
        }
    }
    #endregion


}